package com.be.beadmin.system.controller.ProjectDesignController;

import com.be.beadmin.common.entity.PageEntity;
import com.be.beadmin.common.exception.BeadminException;
import com.be.beadmin.common.utils.ResultModel;
import com.be.beadmin.product.service.WorkOrderInforService;
import com.be.beadmin.system.service.ProductMaterialService.WorkOrderInforPmService;
import com.be.beadmin.system.service.ProjectDesignSevice.ProjectProgressService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Description:
 * @author: Jiaming Zheng
 * @Date: Create in 11:36 2023/6/23
 * @Modified By:
 **/
@Api(tags = {"项目进度"})
@RestController
public class ProjectProgressController {



//    @Autowired
//    private ProjectProgressService projectProgressService;

    @Autowired
    private WorkOrderInforService workOrderInforService;
    @ApiOperation("获取项目进度")
    @PostMapping("/product/getProjectProgress")
    public ResultModel getProjectProgress(HttpServletRequest request , @RequestBody PageEntity pageEntity){
        try {
            return ResultModel.success(workOrderInforService.getWorkOrderInforExtendByPage(request,pageEntity)) ;
        } catch (BeadminException e) {
            return ResultModel.error(-1,e.getMessage());
        } catch (Exception e) {
            return ResultModel.error(-2,e.getMessage());
        }

    }

}
